<template>
  <div >
    <!-- 基本信息 -->
    <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
      <div class="blue_item" />
      <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">交付进度</span> 
    </div>
    <el-table :data="fromdata.deliveryList" border style="width: 100%">
      <el-table-column prop="deliveryPhase" label="交付阶段"/>
      <el-table-column prop="contractSchedule" label="合同正文进度条款"/>
      <el-table-column prop="deliveryDate" label="合同计划交付年月"/>
      <el-table-column prop="contractDeadline" label="合同工期要求(天)"/>
    </el-table>

    <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
      <div class="blue_item" />
      <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">交资交维</span> 
    </div>
    <van-field readonly required name="maintainStartTime" :value="fromdata.maintainStartTime" label="维保起始时间:" label-width="7em" />
    <van-field readonly required name="maintainEndTime" :value="fromdata.maintainEndTime" label="维保到期时间:" label-width="7em" />
    <van-field readonly required name="saleJwTime" :value="fromdata.saleJwTime" label="售中交维时间:" label-width="7em" />
    <van-field readonly required name="maintenancePeriod" :value="fromdata.maintenancePeriod" label="项目维护期（年）:" label-width="9em" />
    <van-field readonly required name="maintenanceCost" :value="fromdata.maintenanceCost" label="维保费（万元）:" label-width="8em" />
    <van-field v-if="fromdata.projectServiceContent=='纯运维'" readonly required name="maintainEnterTime" :value="fromdata.maintainEnterTime" label="运维人员进场时间:" label-width="8.5em" />
    <van-field readonly name="contractNumberPre" :value="fromdata.contractNumberPre" label="项目前向合同编号:" label-width="9em" />
    <van-field readonly name="contractNumberSuf" :value="fromdata.contractNumberSuf" label="项目后向合同编号:" label-width="9em" />
    <van-field readonly required name="managerName" :value="fromdata.managerName" label="售后服务经理姓名:" label-width="9em" />
    <van-field readonly required name="managerUserName" :value="fromdata.managerUserName" label="OA账号:" label-width="4.5em" />
    <van-field readonly required name="managerPhone" :value="fromdata.managerPhone" label="联系方式:" label-width="5em" />
    <van-field readonly required name="managerOrg" :value="fromdata.managerOrg" label="组织:" label-width="3em" />
    <van-field readonly name="implementationFile" label="工程实施方案:" label-width="7em" />
    <div v-for="(fileitem) in fromdata.implementationFile" :key="fileitem.id+'a'" style="margin-left:20px">
      <div readonly class="font14 fileLink" style="color:#0F85CF">
        <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
      </div>
    </div>
    <van-field readonly name="operationPlanFile" label="工程作业计划:" label-width="7em" />
    <div v-for="(fileitem) in fromdata.operationPlanFile" :key="fileitem.id+'b'" style="margin-left:20px">
      <div readonly class="font14 fileLink" style="color:#0F85CF">
        <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
      </div>
    </div>
    <van-field readonly name="systemFile" label="系统设施清单:" label-width="7em" />
    <div v-for="(fileitem) in fromdata.systemFile" :key="fileitem.id+'c'" style="margin-left:20px">
      <div readonly class="font14 fileLink" style="color:#0F85CF">
        <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
      </div>
    </div>
    <van-field readonly name="assetsFile" label="交维资产信息:" label-width="7em" />
    <div v-for="(fileitem) in fromdata.assetsFile" :key="fileitem.id+'d'" style="margin-left:20px">
      <div readonly class="font14 fileLink" style="color:#0F85CF">
        <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
      </div>
    </div>
    <van-field readonly name="otherFile" label="其他附件:" label-width="5em" />
    <div v-for="(fileitem) in fromdata.otherFile" :key="fileitem.id+'e'" style="margin-left:20px">
      <div readonly class="font14 fileLink" style="color:#0F85CF">
        <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
      </div>
    </div>
    <van-field readonly autosize type="textarea" rows="1" name="remark" :value="fromdata.remark" label="备注:" label-width="3em" />
    <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
      <div class="blue_item" />
      <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">附件区(售前文件)</span> 
    </div>
    <van-field v-if="fromdata.competitiveMode=='投标'" readonly name="clientFile" label="招标文件:" label-width="5em" />
    <div v-if="fromdata.competitiveMode=='投标'">
      <div v-for="(fileitem) in fromdata.clientFile" :key="fileitem.id+'f'" style="margin-left:20px">
        <div readonly class="font14 fileLink" style="color:#0F85CF">
          <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
        </div>
      </div>
    </div>
    <van-field v-if="fromdata.competitiveMode=='投标'" readonly name="companyFile" label="应标文件:" label-width="5em" />
    <div v-if="fromdata.competitiveMode=='投标'">
      <div v-for="(fileitem) in fromdata.companyFile" :key="fileitem.id+'g'" style="margin-left:20px">
        <div readonly class="font14 fileLink" style="color:#0F85CF">
          <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
        </div>
      </div>
    </div>
    <van-field v-if="fromdata.competitiveMode=='投标'" readonly name="winBidFile" label="中标通知书:" label-width="6em" />
    <div v-if="fromdata.competitiveMode=='投标'">
      <div v-for="(fileitem) in fromdata.winBidFile" :key="fileitem.id+'h'" style="margin-left:20px">
        <div readonly class="font14 fileLink" style="color:#0F85CF">
          <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
        </div>
      </div>
    </div>
    <van-field readonly :required="fromdata.competitiveMode=='直签'" name="projectDecisionDocument" label="预立项文件:" label-width="6em" />
    <div v-for="(fileitem) in fromdata.projectDecisionDocument" :key="fileitem.id+'i'" style="margin-left:20px">
      <div readonly class="font14 fileLink" style="color:#0F85CF">
        <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
      </div>
    </div>
    <van-field readonly :required="fromdata.competitiveMode=='直签'" name="technicalPlanFile" label="技术方案:" label-width="5em" />
    <div v-for="(fileitem) in fromdata.technicalPlanFile" :key="fileitem.id+'j'" style="margin-left:20px">
      <div readonly class="font14 fileLink" style="color:#0F85CF">
        <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
      </div>
    </div>
    <van-field v-if="fromdata.competitiveMode=='投标'" readonly name="purchaseFile" label="采购需求文件:" label-width="7em" />
    <div v-if="fromdata.competitiveMode=='投标'">
      <div v-for="(fileitem) in fromdata.purchaseFile" :key="fileitem.id+'k'" style="margin-left:20px">
        <div readonly class="font14 fileLink" style="color:#0F85CF">
          <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
        </div>
      </div>
    </div>
    <van-field readonly name="contractPreFile" label="前向合同扫描件:" label-width="8em" />
    <div v-for="(fileitem) in fromdata.contractPreFile" :key="fileitem.id+'l'" style="margin-left:20px">
      <div readonly class="font14 fileLink" style="color:#0F85CF">
        <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
      </div>
    </div>
    <van-field readonly name="contractSufFile" label="后向合同扫描件:" label-width="8em" />
    <div v-for="(fileitem) in fromdata.contractSufFile" :key="fileitem.id+'m'" style="margin-left:20px">
      <div readonly class="font14 fileLink" style="color:#0F85CF">
        <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
      </div>
    </div>
    <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
      <div class="blue_item" />
      <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">附件区(售中文件)</span> 
    </div>
    <div v-for="(fileList,index) in fromdata.processFileList" :key="index">
      <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;margin-right: 16px;margin-left: 16px;">
        <span class="font14" style="display: flex; line-height: 33px;flex:1;color:#999999">{{'进度阶段('+fileList.milestoneNode+'):'}}</span> 
      </div>
      <div v-for="(fileitem) in fileList.processProveFileList" :key="fileitem.id+index" style="margin-left:20px">
        <div readonly class="font14 fileLink" style="color:#0F85CF">
          <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
        </div>
      </div>
    </div>
    <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
      <div class="blue_item" />
      <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">拆分表</span> 
    </div>
    <el-table :data="fromdata.incomeModelList" border style="width: 100%">
      <el-table-column prop="splitBusinessType" label="业务大类"/>
      <el-table-column prop="splitSujectName" label="科目名称"/>
      <el-table-column prop="splitIncludedAmount" label="含税总金额(元)"/>
      <el-table-column prop="splitNoAmount" label="不含税总金额(元)"/>
      <el-table-column prop="splitTaxAmount" label="税额(元)"/>
      <el-table-column prop="billingTime" label="计费时长(月)"/>
      <el-table-column prop="splitStartDate" label="预计计费起始日期"/>
      <el-table-column prop="splitEndDate" label="预计计费结束日期"/>
    </el-table>  
    <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
      <div class="blue_item" />
      <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">合作伙伴</span> 
    </div>
    <el-table :data="fromdata.partnerList" border style="width: 100%">
      <el-table-column prop="partnerName" label="合作伙伴名称"/>
      <el-table-column prop="partnerCode" label="合作伙伴编码"/>
      <el-table-column prop="contact" label="联系人"/>
      <el-table-column prop="contactPhone" label="联系人电话"/>
      <el-table-column prop="partnerSelectionTime" label="合作伙伴甄选时间"/>
      <el-table-column prop="purchaseName" label="采购名称"/>
    </el-table> 
    <div style="padding-bottom: 42px"></div>
  </div>
</template>
<script>
import { mapGetters } from "vuex"
import { openFileUrl } from '@/store/openFile'
export default {
  data() {
    return {
      
    }
  },
  computed: {
    ...mapGetters(['user']),
  },
  props: ['businessdata','fromdata','showHistory','historydata','approveList','canEditbusinessName',],
  created() {
    
  },
  watch: {
    fromdata: {
      handler() {
        this.$emit('freshData', this.fromdata)
      },
      deep: true,  // 可以深度检测到 obj 对象的属性值的变化
      immediate: true //刷新加载  立马触发一次handler
    },
  },
  methods: {
   openFileUrlfun(value) {
      this.$router.push(
        {
          name: 'fileview',
          query: {
            openFileUrl: openFileUrl(value)
          }
        }
      );
    },
  },
}
</script>
 
<style>
.tables.el-table .cell {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-all;
    line-height: 15px;
    padding-left: 5px;
    padding-right: 5px;
}
</style>